package app.r_teenus.frontend.controller;


import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;

import app.r_teenus.backend.dao.ServiceRequestDao;
import app.r_teenus.backend.model.ServiceRequest;



@Controller
public class ServiceRequestController {

    final Logger logger = LoggerFactory.getLogger(ServiceRequestController.class);
    
    static final String SEARCH_VIEW_PATH_KEY = "/serviceRequest";
    private static final String SEARCH_VIEW_KEY = "redirect:/serviceRequest.html";

    @Autowired
    protected ServiceRequestDao requestDao = null;

    /**
     * <p>Deletes a person.</p>
     * 
     * <p>Expected HTTP POST and request '/person/delete'.</p>
     */
    @RequestMapping(value="/serviceRequest/saveOrder", method=RequestMethod.POST)
    public String saveOrder(Integer id) {
//        requestDao.deleteRequest(id);

        return SEARCH_VIEW_KEY;
    }

    /**
     * <p>Searches for all persons and returns them in a 
     * <code>Collection</code>.</p>
     * 
     * <p>Expected HTTP GET and request '/person/search'.</p>
     */
//    @RequestMapping(value="/r/search", method=RequestMethod.GET)
//    public @ModelAttribute(SEARCH_MODEL_KEY) Collection<Person> search() {
//        return requestDao.findPersons();
//    }
}
